<template>
  <div class="home">
      <van-search disabled  placeholder="请输入搜索关键词" @click="$router.push('/home/searchPopup').catch(err=>{})"/>
      <van-swipe class="my-swipe" :autoplay="3000" indicator-color="blue">
          <van-swipe-item v-for="item in banner" :key="item.id">
            <img :src="item.image_url" alt="" srcset="">
          </van-swipe-item>
          
      </van-swipe>
      <transition name="van-slide-right">
          <router-view></router-view>
     </transition>
      
  </div>
</template>
<script>
import {GetHomeList} from '@/utils/api'
export default {
  name:'Home',
  data(){
      return{
         //轮播图
          banner:[]
      }
  },
  created(){
    GetHomeList().then(res=>{
      console.log(res)
      this.banner = res.data.data.banner
    })
  }
}
</script>

<style lang="scss">
 .home{
    width: 100%;
    height: 100%;
    
    }
  .van-search{
    background: #fff;
  }
  .van-search__content{
    border-radius: .625rem;
  }
  .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    height: 150px;
    line-height: 150px;
    text-align: center;
     img{
       width: 100%;
       height: 100%;
     }
   
  }
</style>
